package network;

import android.content.Context;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by Ren on 2018/10/17.
 */

public abstract class BaseCallBack<T> implements Callback<T> {

    private Context mContext;

    @Override
    public void onResponse(Call<T> call, Response<T> response) {
        Success(call,response);
        onFinally();
    }

    @Override
    public void onFailure(Call<T> call, Throwable t) {

        Failure(call,t);
        onFinally();
    }

    public abstract void Success(Call<T> call, Response<T> response);

    public abstract void Failure(Call<T> call, Throwable t);

    public abstract void onFinally();
}
